I need to add Data to DataGrid programmatically in WPF which is not databind.The DataGrid has 4 columns.
How to add Data to a WPF datagrid programmatically
9720
03-Feb-2014
Pravesh Singh
03-Feb-2014In the following MainWindow.xaml I name the Grid MainGrid to access it in the code behind:
The DataItem class is not a WPF class, but a custom class created by Yourself:
To let the DataGrid display data stored in DataItem objects programmatically, You may do the following:
I hope this helps.